package com.easylinkin.linkappapi.common.utils.file;


import java.util.Date;
import java.util.Map;
import java.util.StringJoiner;
import org.apache.commons.lang3.StringUtils;
/**
 * <p></p>
 *
 * @author TongJie
 * @since 2020/4/15 18:43
 */

public class GridFile {
    private String fileId;
    private String fileName;
    private byte[] fileContent;
    private String fileType;
    private String saveUser;
    private String saveSystem;
    private Date saveTime;
    private Map<String, Object> customInfo;
    private SambaFile sambaFile = new SambaFile();

    public GridFile() {
    }

    public String getFileId() {
        return this.fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getFileName() {
        return this.fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public byte[] getFileContent() {
        return this.fileContent;
    }

    public void setFileContent(byte[] fileContent) {
        this.fileContent = fileContent;
    }

    public String getFileType() {
        return this.fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getSaveUser() {
        return this.saveUser;
    }

    public void setSaveUser(String saveUser) {
        this.saveUser = saveUser;
    }

    public String getSaveSystem() {
        return this.saveSystem;
    }

    public void setSaveSystem(String saveSystem) {
        this.saveSystem = saveSystem;
    }

    public Date getSaveTime() {
        return this.saveTime;
    }

    public void setSaveTime(Date saveTime) {
        this.saveTime = saveTime;
    }

    public Map<String, Object> getCustomInfo() {
        return this.customInfo;
    }

    public void setCustomInfo(Map<String, Object> customInfo) {
        this.customInfo = customInfo;
    }

    public SambaFile getSambaFile() {
        return this.sambaFile;
    }

    public boolean isUseSamba() {
        return this.sambaFile != null && StringUtils.isNotBlank(this.sambaFile.getSmbUri());
    }

    @Override
    public String toString() {
        return (new StringJoiner(", ", GridFile.class.getSimpleName() + "[", "]")).add("fileId='" + this.fileId + "'").add("fileName='" + this.fileName + "'").add("fileType='" + this.fileType + "'").add("saveUser='" + this.saveUser + "'").add("saveSystem='" + this.saveSystem + "'").toString();
    }
}
